<!--
 * @FilePath     : /jquery/demo/101-9.html
 * @Description  : .extend() 合并一个对象
 * @Date         : 2025-03-26 17:24:49
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-03-26 17:26:09
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <link rel="stylesheet" href="" />
  </head>
  <body>
    <h2>jq 服务静态页</h2>

    <script src="/library/jquery.min.js"></script>
    <script src="/common/common.js"></script>
    <script>
      // d1 合并 settings 和 options，修改并返回 settins
      var settings = { validate: false, limit: 5, name: 'foo' }
      var options = { validate: true, name: 'bar' }
      const obj = jQuery.extend(settings, options)
      console.log(1, obj)
      /*
      { validate: true, limit: 5, name: "bar" }
      */
      console.log(2, settings)
      console.log(3, options)
      console.log(4, obj === settings)
    </script>
  </body>
</html>
